package com.dreamchaser.familydevice.service;


import com.dreamchaser.familydevice.dao.UserMapper;
import com.dreamchaser.familydevice.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements ILoginService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Integer register(User user) {
        return userMapper.insert(user);
    }

    @Override
    public User login(String userName, String password) {
        return userMapper.selectByUsernNameAndPwd(userName,password);
    }

    @Override
    public String selectAccount(String account) {
        return userMapper.selectByUserName(account);
    }
}
